using System;
using System.Collections.Generic;
using System.Xml;
namespace HKB.Alipay
{
	public class Service
	{
		private string _partner = "";
		private string _input_charset = "";
		private string _seller_email = "";
		private string _return_url = "";
		private string _notify_url = "";
		private string GATEWAY_NEW = "https://mapi.alipay.com/gateway.do?";
		public Service()
		{
			this._partner = Config.Partner.Trim();
			this._input_charset = Config.Input_charset.Trim().ToLower();
			this._seller_email = Config.Seller_email.Trim();
			this._return_url = Config.Return_url.Trim();
			this._notify_url = Config.Notify_url.Trim();
		}
		public string Create_direct_pay_by_user(SortedDictionary<string, string> sParaTemp)
		{
			sParaTemp.Add("service", "create_direct_pay_by_user");
			sParaTemp.Add("_input_charset", this._input_charset);
			string strButtonValue = "确认";
			return Submit.BuildFormHtml(sParaTemp, this.GATEWAY_NEW, "get", strButtonValue);
		}
		public string Query_timestamp()
		{
			string url = this.GATEWAY_NEW + "service=query_timestamp&partner=" + this._partner;
			XmlTextReader reader = new XmlTextReader(url);
			XmlDocument xmlDocument = new XmlDocument();
			xmlDocument.Load(reader);
			return xmlDocument.SelectSingleNode("/alipay/response/timestamp/encrypt_key").InnerText;
		}
		public string AlipayInterface(SortedDictionary<string, string> sParaTemp)
		{
			return "";
		}
	}
}
